//
//  InfoBirthView.m
//  GuiderHealth
//
//  Created by mo on 2020/8/20.
//  Copyright © 2020 YM&EF. All rights reserved.
//

#import "InfoBirthView.h"
#import "BRPickerView.h"
#import "BaseToolsKit.h"

@interface InfoBirthView()

@end

@implementation InfoBirthView

- (void)chooseBirth{

    // 出生年月日
    BRDatePickerView *datePickerView = [[BRDatePickerView alloc]init];
    datePickerView.pickerMode = BRDatePickerModeYMD;
    datePickerView.title = GDBaselocalString(@"选择生日");
    datePickerView.minDate = [NSDate br_setYear:1900 month:1 day:1];
    datePickerView.resultBlock = ^(NSDate *selectDate, NSString *selectValue) {
        
        //设置日期格式
        if (self.InfoBirthBlock) {
            self.InfoBirthBlock(selectDate,selectValue);
        }
        
    };
    
    BRPickerStyle *customStyle = [[BRPickerStyle alloc] init];
    customStyle.pickerColor = [UIColor whiteColor];
    customStyle.separatorColor = RGB(221, 221, 221);
    customStyle.selectRowTextColor = MainColor;
    customStyle.titleBarHeight = 50;
    customStyle.rowHeight = 44.0;
    customStyle.pickerHeight = 220.0;
    customStyle.titleTextFont = [UIFont systemFontOfSize:16];
    customStyle.hiddenCancelBtn = YES;
    
    datePickerView.pickerStyle = customStyle;
    [datePickerView show];
}

- (void)removeTheView{
    
    for (UIView *tempView in self.subviews) {
        [tempView removeFromSuperview];
    }
    
    [self removeFromSuperview];
}

@end
